Bug 535830 – wrong content type adding an item
authorEmmanuele Bassi <ebassi@gnome.org>
Sat, 31 May 2008 18:52:50 +0000 (18:52 +0000)
committerEmmanuele Bassi <ebassi@src.gnome.org>
Sat, 31 May 2008 18:52:50 +0000 (18:52 +0000)
2008-05-31  Emmanuele Bassi  <ebassi@gnome.org>

Bug 535830 – wrong content type adding an item

* gtk/gtkrecentmanager.c:
(gtk_recent_manager_add_item_query_info): Use the correct API
for retrieving the fast MIME type of a URI. (Carlos Garcia
Campos)

svn path=/trunk/; revision=20262

ChangeLog
gtk/gtkrecentmanager.c

index 789beea884335aba9dd51829e8f53e988516d7ba..c470a3f84f95f542fe9c8b6b357ea0a33a0f1ea9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-05-31  Emmanuele Bassi  <ebassi@gnome.org>
+
+       Bug 535830 – wrong content type adding an item
+
+       * gtk/gtkrecentmanager.c:
+       (gtk_recent_manager_add_item_query_info): Use the correct API
+       for retrieving the fast MIME type of a URI. (Carlos Garcia
+       Campos)
+
 2008-05-31  Kristian Rietveld  <kris@imendio.com>
 
        Bug 530146 - Setting non-string tooltip with
index 626210f1773d6001db3e4b74a65b8d7bb841ac48..076d51e5f3e39bf1f1c991adb1d5197a7f4d2f07 100644 (file)
@@ -764,7 +764,16 @@ gtk_recent_manager_add_item_query_info (GObject      *source_object,
 
   if (file_info)
     {
-      recent_data.mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (file_info));
+      gchar *content_type;
+
+      content_type = g_file_info_get_attribute_as_string (file_info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE);
+
+      if (G_LIKELY (content_type))
+        recent_data.mime_type = g_content_type_get_mime_type (content_type);
+      else
+        recent_data.mime_type = g_strdup (GTK_RECENT_DEFAULT_MIME);
+
+      g_free (content_type);
       g_object_unref (file_info);
     }
   else